<script type="text/javascript">
    function set_title(){
        document.getElementsByTagName('title')[0].innerHTML="<?php global $page, $page_title;
            echo PAGE_TITLE." | ".$page_title;
        ?>";
    }
</script>
<script type="text/javascript">
    $(document).ready(function(){
       $("#left ul li").mouseover(function(){
           $(this).stop().animate({backgroundPosition:"-170px"});
       });
    });
    $(document).ready(function(){
       $("#left ul li").mouseout(function(){
           $(this).stop().animate({backgroundPosition:"0px"});
       });
    });
</script>
<ul style="text-align: right">
    <?php
        global $page;
        $class_atb = $page=='home' || $page==''?'class="active"':'class="inactive"';
    ?>
    <li  <?php echo $class_atb ?> ><a href="<?php echo ABS_URL; ?>">Home</a></li>
    <?php
        /*Neu da dang nhap*/
        if(isset($_SESSION["username"])){
            $class_atb = $page=='userinfo'?'class="active"':'class="inactive"';
            echo '<li '.$class_atb.'> <a href="'.ABS_URL.'?page=userinfo&userid='.$_SESSION["id"].'">My Infomations</a></li>';
            $class_atb = $page=='topics'?'class="active"':'class="inactive"';
            //echo '<li '.$class_atb.'> <a href="'.ABS_URL.'?page=topics&act=showall">Topics</a></li>';

                $class_atb = $page=='topic1'?'class="active"':'class="inactive"';
                echo '<li '.$class_atb.'> <a href="'.ABS_URL.'?page=topic1&act=showall">Topics</a></li>';
            

            /*Neu la quan tri vien*/
            if(have_permission($groupid=3)){
                $class_atb = $page=='admin'?'class="active"':'class="inactive"';
                echo '<li '.$class_atb.'> <a href="'.ABS_URL.'?page=admin&act=users">Users manager</a></li>';
            }
            $class_atb = $page=='sign'?'class="active"':'class="inactive"';
            
        }else{
            $class_atb = $page=='sign'?'class="active"':'class="inactive"';
            echo '<li '.$class_atb.'>
                  <a href="'.ABS_URL.'?page=sign"> Login </a></li>';
        }
        echo $page=='about'?'<li class="active">
              <a href="'.ABS_URL.'?page=about"> Contact us </a></li>':"";
    ?>
    

</ul>